package com.workstudy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.workstudy.domain.Loginlog;
import com.workstudy.mapper.LoginlogMapper;
import com.workstudy.model.LogModel;
import com.workstudy.service.LoginlogService;
import zhibi.common.support.base.Page;
import zhibi.common.support.base.service.BaseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import zhibi.common.support.mybatis.example.Example;

/**
* The class create by 执笔 on generate.
*/
@Service
@Transactional
public class LoginlogServiceImpl extends BaseServiceImpl<Loginlog> implements LoginlogService{

    @Autowired
    public LoginlogServiceImpl(LoginlogMapper mapper) {
        super(mapper);
        this.loginlogMapper = mapper;
    }
    private LoginlogMapper loginlogMapper;

    @Override
    public PageInfo<LogModel> selectModel(Example example, Page page) {

        if(null != page) PageHelper.startPage(page.getPageNum(),page.getPageSize());
        return new PageInfo<>(loginlogMapper.selectModel(example),Page.NAV_SIZE);
    }
}